<template>
  <div>
    <el-form
      ref="formDataSampleDeliveryInfo"
      class="base-pipeline-layout"
      :model="formDataSampleDeliveryInfo"
      :rules="formDataSampleDeliveryInfoRules"
      status-icon
      label-width="110px"
    >
      <el-form-item
        label="取样地点"
        :error="errorMsgSampleDeliveryInfo.samplingAddress"
      >
        <el-input
          v-model="formDataSampleDeliveryInfo.samplingAddress"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item
        label="取样日期"
        :error="errorMsgSampleDeliveryInfo.samplingDate"
      >
        <el-date-picker
          v-model="formDataSampleDeliveryInfo.samplingDate"
          value-format="yyyy-MM-dd HH:mm:ss"
          :disabled="readOnly"
          type="datetime"
          placeholder="选择日期时间"
        >
        </el-date-picker>

        <!-- <el-input
          v-model="formDataSampleDeliveryInfo.samplingDate"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input> -->
      </el-form-item>
      <el-form-item
        label="产品基数"
        :error="errorMsgSampleDeliveryInfo.productNumber"
      >
        <el-input
          v-model="formDataSampleDeliveryInfo.productNumber"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item label="单份容量" :error="errorMsgSampleDeliveryInfo.count">
        <el-input
          v-model="formDataSampleDeliveryInfo.count"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item
        label="取样方式"
        :error="errorMsgSampleDeliveryInfo.samplingMethod"
      >
        <el-input
          v-model="formDataSampleDeliveryInfo.samplingMethod"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item
        label="样品存储方式"
        :error="errorMsgSampleDeliveryInfo.storageMode"
      >
        <el-input
          v-model="formDataSampleDeliveryInfo.storageMode"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item
        label="封样方式"
        :error="errorMsgSampleDeliveryInfo.sampleSealingMethod"
      >
        <el-input
          v-model="formDataSampleDeliveryInfo.sampleSealingMethod"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item
        label="运送方式"
        :error="errorMsgSampleDeliveryInfo.shippingMethod"
      >
        <el-input
          v-model="formDataSampleDeliveryInfo.shippingMethod"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item
        label="受检单位"
        :error="errorMsgSampleDeliveryInfo.inspectedUnit"
      >
        <el-input
          v-model="formDataSampleDeliveryInfo.inspectedUnit"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item
        label="通讯地址"
        :error="errorMsgSampleDeliveryInfo.postalAddress"
      >
        <el-input
          v-model="formDataSampleDeliveryInfo.postalAddress"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item label="联系人" :error="errorMsgSampleDeliveryInfo.contacts">
        <el-input
          v-model="formDataSampleDeliveryInfo.contacts"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item
        label="邮政编码"
        :error="errorMsgSampleDeliveryInfo.postalCode"
      >
        <el-input
          v-model="formDataSampleDeliveryInfo.postalCode"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item
        label="联系电话"
        :error="errorMsgSampleDeliveryInfo.contactNumber"
      >
        <el-input
          v-model="formDataSampleDeliveryInfo.contactNumber"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item label="传真电话" :error="errorMsgSampleDeliveryInfo.fax">
        <el-input
          v-model="formDataSampleDeliveryInfo.fax"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
      <el-form-item label="电子信箱" :error="errorMsgSampleDeliveryInfo.email">
        <el-input
          v-model="formDataSampleDeliveryInfo.email"
          :disabled="readOnly"
          autocomplete="off"
        ></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "FormDataSampleDeliveryInfo",
  props: {
    readOnly: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      formDataSampleDeliveryInfo: {
        id: 0,
        samplingAddress: "",
        samplingDate: "",
        productNumber: "",
        count: "",
        samplingMethod: "",
        storageMode: "",
        sampleSealingMethod: "",
        shippingMethod: "",
        inspectedUnit: "",
        postalAddress: "",
        contacts: "",
        postalCode: "",
        contactNumber: "",
        fax: "",
        email: "",
      },
      formDataSampleDeliveryInfoRules: {
        samplingAddress: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunctionPositiveNumber,
          },
        ],
        samplingDate: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
        productNumber: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
        count: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunctionPositiveNumber,
          },
        ],
        samplingMethod: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunctionPositiveNumber,
          },
        ],
        storageMode: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
        sampleSealingMethod: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
        shippingMethod: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
        inspectedUnit: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
        postalAddress: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
        contacts: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
        postalCode: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
        contactNumber: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
        fax: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
        email: [
          {
            required: true,
            trigger: "blur",
            validator: this.Helper.validateFunction,
          },
        ],
      },
      errorMsgSampleDeliveryInfo: {
        samplingAddress: "",
        samplingDate: "",
        productNumber: "",
        count: "",
        samplingMethod: "",
        storageMode: "",
        sampleSealingMethod: "",
        shippingMethod: "",
        inspectedUnit: "",
        postalAddress: "",
        contacts: "",
        postalCode: "",
        contactNumber: "",
        fax: "",
        email: "",
      },
    };
  },
  watch: {},
  created() {},
  methods: {},
};
</script>
